package com.dingding.service.user.facade;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.common.core.util.ToolUtil;
import com.dingding.facade.user.dto.SyncDriverAuthDTO;
import com.dingding.facade.user.service.IUserAuthFacade;
import com.dingding.service.user.core.dao.IVehicleInfoDao;

@Component("userAuthFacade")
public class UserAuthFacadeImpl implements IUserAuthFacade {

	@Resource(name = "vehicleInfoDao")
	private IVehicleInfoDao vehicleInfoDao;
	
	/**
	 * @Description: 同步用户的认证状态
	 * @author fengshuonan
	 * @param loginId 用户的登录id
	 * @return SyncDriverAuthDTO
	 */
	@Transactional(readOnly = true)
	public SyncDriverAuthDTO syncDriverAuth(String loginId) {

		if (ToolUtil.isBlank(loginId)) {
			return null;
		}

		return vehicleInfoDao.getDriverAuthInfo(loginId);
	}

}
